<button
    class="del-cell-btn"
    data-x="{{ current_cell_coords[0] }}"
    data-y="{{ current_cell_coords[1] }}"
>
    <i class="fa fa-trash"></i> {% trans %}Delete This Cell{% endtrans %}
</button>

{% if form %}
    <form action="" method="POST" id="xt-editor-form">
        {% csrf_token %}
        <input name="save" type="hidden" value="1"/>
        <input name="publish" type="hidden" value="0"/>
        <table>
            {{ form.forms['general'].as_table()|safe }}
        </table>
        <hr>
        {% if "plugin" in form.forms %}
            {% set translated_fields = form.plugin.translatable_field_names %}
            {% set monolingual_fields = form.plugin.monolingual_field_names %}
            {% if translated_fields %}
                <div>
                    <ul class="editor-tabs nav nav-tabs">
                        {% for language_code in form.plugin.get_languages() %}
                        <li role="presentation" {% if language_code == LANGUAGE_CODE %}class="active"{% endif %}>
                            {% if language_code == "*" %}
                                <a href="#untranslated" data-toggle="tab">{% trans %}Untranslated{% endtrans %}</a>
                            {% else %}
                                <a href="#{{ language_code }}" data-toggle="tab">{{ language_code }}</a>
                            {% endif %}
                        </li>
                        {% endfor %}
                    </ul>
                    <div class="tab-content">
                        {% for language_code in form.plugin.get_languages() %}
                            <div role="tabpanel" class="tab-pane {% if language_code == LANGUAGE_CODE %}active{% endif %}"
                                {% if language_code == "*" %}
                                    id="untranslated"
                                {% else %}
                                    id="{{ language_code }}"
                                {% endif %}
                            >
                                <br>
                                <table>
                                {% for field in translated_fields %}
                                    <tr>
                                        <th>{{ form.forms["plugin"][field + "_" + language_code].label }}({{ language_code }}):</th>
                                        <td>{{ form.forms["plugin"][field + "_" + language_code] }}</td>
                                    </tr>
                                {% endfor %}
                                </table>
                            </div>
                        {% endfor %}
                    </div>
                </div>
                {% if monolingual_fields %}<hr>{% endif %}
            {% endif %}
            {% if monolingual_fields %}
                <table>
                {% for field in monolingual_fields %}
                    <tr>
                        <th>
                            <div>{{ form.forms["plugin"][field].label }}:</div>
                            <div><small class="text-muted">{{ form.forms["plugin"][field].help_text }}</small></div>
                        </th>
                        <td>{{ form.forms["plugin"][field] }}</td>
                    </tr>
                {% endfor %}
                </table>
            {% endif %}
        {% else %}
            <i>{% trans %}There's nothing to configure in this plugin.{% endtrans %}</i>
        {% endif %}
        <hr>
        <button class="submit-form-btn" type="submit"><i class="fa fa-save"></i> {% trans %}Save Plugin{% endtrans %}</button>
        <p class="text-warning">
            {% trans -%}
                Remember to publish your changes for this placeholder when you are done, by clicking the Publish Changes button at the top.
            {%- endtrans %}
        </p>
    </form>
{% endif %}
